﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
	<meta charset="utf-8" />
    <script src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
        function MyClick1()
        {
            var username = $("#txtUserName").val();
            var pwd = $("txtPwd").val();
            //sessionStorage.setItem("k_username", username);
            //sessionStorage.setItem("k_pwd", pwd);
            localStorage.setItem("k_username", username);
            localStorage.setItem("k_pwd", pwd);
            alert("存储成功！");
        }
        function MyClick2()
        {
            //alert(sessionStorage.getItem("k_username"));
            //alert(sessionStorage.getItem("k_pwd"));
            alert(localStorage.getItem("k_username"));
            localStorage.clear();
            alert(localStorage.getItem("k_username"));

        }
    </script>
</head>
<body background="img/1.jpg" size="100%">
    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
    <center><input type="text" id="txtUserName" /><br /><br />
    <input type="password" id="txtPwd" /><br /><br />
    <input type="button" value="存储" onclick="MyClick1()"/ >
    <input type="button" value="显示" onclick="MyClick2()" </center>
</body>
</html>
